import React, {useEffect, useState} from "react";
import {useLocation, useNavigate} from "react-router-dom";
import {
    Form,
    Input,
    Button,
    TextArea,
} from 'antd-mobile'

const FaultAdd = () => {
    const navigate = useNavigate()

    return <Form
        layout='horizontal' mode='card'
        footer={
            <Button block type='submit' color='primary' size='large' onClick={() => {
                navigate('/')
            }}>
                提交
            </Button>
        }>
        <Form.Item name={['device', 'name']} label='设备名称'>
            <Input placeholder='请输入'/>
        </Form.Item>
        <Form.Item name={['device', 'machineRoom']} label='机房名称'>
            <Input placeholder='请输入'/>
        </Form.Item>
        <Form.Item name='type' label='设备类型'>
            <Input placeholder='请输入'/>
        </Form.Item>
        <Form.Item name='describe' label='基本问题描述'>
            <TextArea
                placeholder='请输入' maxLength={100} rows={2} showCount/>
        </Form.Item>
        <Form.Item name='maintenancePerson' label='报修人姓名'>
            <Input placeholder='请输入'/>
        </Form.Item>
        <Form.Item name='contact' label='联系方式'>
            <Input placeholder='请输入'/>
        </Form.Item>
    </Form>

}

export default FaultAdd
